﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Owin;
using System.Web.Http;  


namespace Group3.MediaTool.OWIN
{
    /// <summary>
    /// @Version 1.0
    /// @Author Pascal Senjic
    /// @Comment
    ///     Startup configures Web API. This class is the type for 
    ///     the parameter in the WebApp.Start method.
    ///     WebApp.Start starts the selfhosted webservice
    ///     This SourceCode based on http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api
    /// </summary>
    public class Startup
    {

        public void Configuration(IAppBuilder appBuilder)
        {
            // Configure Web API for self-host. 
            HttpConfiguration config = new HttpConfiguration();
            config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action_id}",
                defaults: new { action_id = RouteParameter.Optional }
            );

            appBuilder.UseWebApi(config); 

        }
    }
}
